package com.ltsznh.android.anti_villain;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.MediaRecorder;
import android.os.Environment;
import android.os.IBinder;
import android.os.Vibrator;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;

import java.io.File;
import java.text.SimpleDateFormat;

public class AntiVillainService extends Service {

    @Override
    public IBinder onBind(Intent intent) {
        // TODO: Return the communication channel to the service.
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.v("dddd","service create!===========================");
        TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

        AntiVillainReceiver.phoneListener.context = AntiVillainService.this;
        telephonyManager.listen(AntiVillainReceiver.phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
        Log.v("dddd","service create  finished!===========================");
    }
}
